"use strict";

angular.module("app").directive("appPositionInfo", [function(){
	return {
		restrict: "A",
		replace: true,
		templateUrl: "view/template/positionInfo.html",
		scope: {
			isActive: "=",
			isLogin: "=",
			pos: "=",
		},
		link: function(scope){
			scope.select = 0;
			scope.imagePath = scope.select?"image/star-active.png":"image/star.png";
			scope.favorite = function(){
				
				//TODO: 与服务器数据交互
				scope.select = !scope.select;
				scope.imagePath = scope.select?"image/star-active.png":"image/star.png";
				
			}
		}
	};
}]);